package org.example.leetCode;

/**
 * @author Administrator
 */
public class ReverseNum {
    public int reverse(int x) {
        long res = 0L;
        while (x != 0) {
            res = res * 10 + x % 10;
            x = x / 10;
        }
       return (int)res==res? (int) res :0;
    }
}
